<?php
$app = Yii::app();
$baseUrl = $app->request->baseUrl;
$imageUrl = "$baseUrl/images";
?>

<html class="no-js" lang="en">
	<head>
		<meta charset="utf-8">

		<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl; ?>/css/foundation.css" />
		<link rel="stylesheet" type="text/css" href="<?php echo $baseUrl; ?>/css/app.css" />

		<title><?php echo CHtml::encode($this->pageTitle); ?></title>
	</head>

	<body>
		<div class="container">
			<div class="row">
				<ul id="header" class="twelve columns nav-bar">
					<li><a href="<?php echo $baseUrl ?>"><img src="<?php echo $imageUrl ?>/home.png" />Home</a></li>
					<?php if (Yii::app()->user->isGuest) { ?>
						<li class="right"><a href="<?php echo $this->createUrl('user/login') ?>">Login</a></li>
						<li><a href="<?php echo $this->createUrl('user/register') ?>">Register</a></li>
					<?php } else { ?>
						<li class="right"><a href="<?php echo $this->createUrl('user/view', array('id' => $app->user->id)) ?>"><img src="<?php echo $imageUrl ?>/shop.png" />My Shop</a></li>
						<li class="right"><a href="<?php echo $this->createUrl('user/update', array('id' => $app->user->id)) ?>"><img src="<?php echo $imageUrl ?>/profile.png" />Edit Shop Details</a></li>
						<li class="right"><a href="<?php echo $this->createUrl('item/create') ?>"><img src="<?php echo $imageUrl ?>/new.png" />New Item</a></li>
                                                <li class="right"><a href="<?php echo $this->createUrl('user/DisplayCart') ?>">Shopping Cart</a></li>
                                                <li class="right"><a href="<?php echo $this->createUrl('user/logout') ?>">Logout</a></li>
                                                <li class="lastright" id="search">
                                                    <form action="<?php echo $this->createUrl('item/search') ?>" method="get">
                                                        Search: <input id="sbox" name="searchBox" type="text">
                                                    </form>
                                                </li>
					<?php } ?>
				</ul>
			</div>
			<?php echo $content ?>
		<div class="row clear">
			<br />
			<p class="right lead">You spent a total of <b>$<?php echo $app->user->getState('spent', 0) ?></b></p>
		</div>
		</div>
	</body>
</html>